package org.com.behavioralPattern.interpreterPattern;

/**
 * 加法运算
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/28 10:33
 */
public class Plus implements ArithmeticExpression {
    private ArithmeticExpression left;
    private ArithmeticExpression right;


    public Plus(ArithmeticExpression left,ArithmeticExpression right){
        this.left=left;
        this.right=right;
    }

    @Override
    public int interpret(Variables variables) {
        return left.interpret(variables)+right.interpret(variables);
    }


}
